#pragma once


#include "UIBaseTool/DataPublic.h"
#include <Interactiv_BIM/ChaiDanCommand>
#include "Interactiv_BIM/Export"

class Interactiv_BIM__EXPORT  OcCommandFactory : public OcRxFactory<DesignerDlgTypePublic, ChaiDanCommand>
{
public:
	OcCommandFactory(DesignerDlgTypePublic type);
	virtual ~OcCommandFactory(void);

public:
	virtual ChaiDanCommand * Creat(void* pData = NULL) = 0;
	virtual void destroy(ChaiDanCommand *Obj, void* pData = NULL);
};

//{{begin RegistOcUiDockControlBarBaseFactory
#define RegistOcCommandFactory(ClassData, DOCKINGCONTROLBARIDTYPE) \
class  ClassData##OcCommand : public OcCommandFactory \
{ \
public: \
	ClassData##OcCommand(void) : \
	OcCommandFactory(DOCKINGCONTROLBARIDTYPE) \
    { \
	g_pCommandControlBar->RegisitFactory(mType, this); \
    } \
	virtual ~ClassData##OcCommand(void){ ; } \
    \
public: \
	virtual ChaiDanCommand * Creat(void* pData) \
  { \
  ChaiDanCommand * pCommand = new ClassData((Interactiv_::Interactiv_Base*)pData, DOCKINGCONTROLBARIDTYPE); \
  return  pCommand; \
  } \
}; \
	ClassData##OcCommand* __ClassData##OcCommand = new ClassData##OcCommand(); \

